<html>
    <head>
        <title>Login to BuzzPulse</title>
        <link type="text/css" rel="stylesheet" href="CSS/Desktop/login.css"/>
        <script type="text/javascript" src="JS/Desktop/jquery-1.10.2.min.js"></script>
        <script type="text/javascript" src="JS/Desktop/client.js"></script>
        <script type="text/javascript" src="JS/Desktop/md5.js"></script>
        <script type="text/javascript">
            var curRequests = [];
            var test;
            function getlogin() {
                var pl = new SOAPClientParameters();
                pl.add("typedata", "login");
                pl.add("email", document.login.username.value.trim());
                pl.add("password", hex_md5(document.login.password.value.trim()));
                SOAPClient.invoke("/m/", "getLogin", pl, true, login);
            }

            function login(r) {
                if (r === null) {
                    document.getElementById('error').innerHTML = 'Email and password does not match. Please try again';
                }
                if (r["email"] !== "") {
                    if (document.login.password.value === 'buzzpulse') {
                        window.location = '/#settings/account';
                        window.location.reload(true);
                    }
                    else
                        window.location.reload(true);
                }
            }
        </script>
    </head>
    <body>
        <div class="login-container">
            <a href="#" class="logo">
                <img class="logoimage" src="Images/logo_beta.png" witdh="250px"/>
            </a>
            <form name="login" action="" method="POST" onsubmit="getlogin();
                return false;">
                <label>Your Username or Email:</label>
                <input type="text" placeholder="Your Username or Email" name="username" id="id_username">
                <label>Your Password:</label>
                <input type="password" placeholder="Your Password" name="password" id="id_password">
                <div id="error" style="color: red; font-family: Calibri; font-size: 11pt;">&nbsp;</div>
                <div class="btn-holder" style="margin-top: 5px;"><input type="submit" class="btn btn-red" value="Log me in"></div>       
                <a class="forgot-password-link" style="margin-top: 10px" href="/front/account/forgot_password/">I forgot my password</a>
            </form>
        </div>
    </body>
</html>

